import HttpServer from '../utils/HttpServer'
import qs from 'qs';

export const getGlobalConfig = (http, params, token) => {
    return HttpServer.post(http + '/olap-board/board/get', qs.stringify(params), {
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            token
        }
    })
}

export const getDimensionValues = (http, params, token) => {
    return HttpServer.post(http + '/olap-data/dataset/getDimensionValues1', qs.stringify(params), {
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            token
        }
    })
}

export const getDataset = (http, params, token) => {
    return HttpServer.post(http + '/olap-data/dataset/get', qs.stringify(params), {
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            token
        }
    })
}

export const getAggregateData = (http, params, token) => {
    return HttpServer.post(http + '/olap-data/dataset/getAggregateData', qs.stringify(params), {
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            token
        }
    })
}

export const getTreeDimValue = (http, params, token) => {
    return HttpServer.post(http + '/olap-data/dataset/getTreeDimValue', qs.stringify(params), {
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            token
        }
    })
}
export const getTreeDimValueByName = (http, params, token) => {
    return HttpServer.post(http + '/olap-data/dataset/getTreeDimValueByName', qs.stringify(params), {
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            token
        }
    })
}

export const downloadExcel = (http, params, token) => {
    window.open(http + '/olap-data/excel/downLoad?' + qs.stringify(params))
}